<?php
$this->breadcrumbs=array(Lang::t('news.list.page.title'));
?>

<div class="page-nav text-right">
    <a href="<?php echo $this->addNewUrl; ?>" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> <?php echo Lang::t('news.list.btn.add.new'); ?></a>
</div>

<?php $this->getFlashes(array('class'=>'alert alert-{status}')); ?>

<!-- <div class="note"><?php echo Lang::t('news.list.form.note'); ?></div> -->

<?php //$this->widget('AdvancedSearchWidget', array('formView' => '_search', 'model' => $model)); ?>

<?php
$dataProvider->pagination->pageSize=Yii::app()->request->getParam('pageSize_', 20);
$this->widget('ext.extended.GridView', array(
    'id' => 'grid',
    'ajaxUpdate'=>false,
    'dataProvider' => $dataProvider,
    'filter' => $model,
    'rowHtmlOptionsExpression'=>implode('; ', array(
        '$data->defaultImage="'.$this->imagesPath.'/news-default.jpg"',
    )),
    'dropDowns' => array(
        'pageSize' => array(
            'label' => 'Results per page',
            'dropDownVar' => 'pageSize_',
            'cssClass'=>'page-size',
            'default' => 10,
            'items' => array(
                10 => 10,
                20 => 20,
                50 => 50,
                80 => 80,
                100 => 100,
            ),
        ),
    ),
    'htmlOptions'=>array(
        'class'=>'table-responsive',
    ),
    'itemsCssClass'=>'table table-hover',
    'columns' => array(
        array(
            'filterHtmlOptions'=>array('class'=>'id-filter'),
            //'header'=>Lang::t('news.lbl.id'),
            'name' => 'id_',
            'value' => '$data->id',
            'htmlOptions' => array('class' => 'id-column'),
        ),
        array(
            'name'=>'image_',
            'value'=>'$data->thumbnail',
            'type'=>'image',
            'htmlOptions'=>array(
                'class' => 'grid-image',
            ),
        ),
        array(
            'name' => 'title_',
            'value' => '$data->title',
        ),
        array(
            'name'=>'postedDate_',
            'value'=>'date("d-M-Y", $data->postedDate)',
            'htmlOptions'=>array(
                'style'=>'width:100px; text-align:center;',
            ),
        ),
        array(
            'name'=>'author_',
            'value'=>'$data->authorName',
            'htmlOptions'=>array(
                'style'=>'width:100px; text-align:center;',
            ),
        ),
        array(
            'header' => 'Publish',
            'type' => 'boolean',
            'filter'=>false,
            'name'=>'publish_',
            'value' => '$data->isPublish',
            'htmlOptions'=>array(
                'style'=>'width:50px; text-align:center;',
            ),
        ),
        array(
            'class' => 'CButtonColumn',
        ),
        array(
            'class' => 'CCheckBoxColumn',
            'selectableRows' => 2,
        ),
    ),
));
?>